using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace CheckAPI{
    public class Check : MonoBehaviour
    {
        public FirstController sceneController;

        void Start()
        {
            sceneController = (FirstController)TheDirector.getInstance().CurrentSceneController;
            sceneController.gameStatusManager=this;
        }

        public int CheckGame(){
            int[] boatRole=sceneController.boat.getRoleNum();
            int[] startRole=sceneController.Land_start.getRoleNum();
            int[] endRole=sceneController.Land_end.getRoleNum();

            if(endRole[0]+endRole[1]==6) return 1;

            if(sceneController.boat.getSide()==1){
                startRole[0]+=boatRole[0];
                startRole[1]+=boatRole[1];
            }else{
                endRole[0]+=boatRole[0];
                endRole[1]+=boatRole[1];
            }

            if((endRole[0]>0 && endRole[1]>endRole[0]) || (startRole[0]>0 && startRole[1]>startRole[0]))
                return -1;
            return 0;
        }
    }
}

